﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Agile_E
{
    public partial class Payroll : System.Web.UI.Page
    {
        private int empid;
        private string name;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                Employees getEmp = new Employees();
                try
                {
                    name = Session["emp_name"].ToString();
                    empid = Convert.ToInt32(Session["Employee_ID"]);
                    DatabaseHandler.connect();
                    getEmp = DatabaseHandler.getEmployeeByID(empid.ToString());
                    name = getEmp.Info.FirstName + " " + getEmp.Info.MiddleName + " " + getEmp.Info.LastName;
                    lblid.Text = getEmp.IDNumber;
                    lblpayrate.Text = getEmp.PayInfo.HourlyPay.ToString();
                    lblcom.Text = getEmp.PayInfo.CommissionRate.ToString();
                    
                }
                catch (Exception ex)
                {
                    ((Main)this.Master).writeStatus(ex.Message, true);
                }
            }
        }

        protected void loadGrid()
        {

            //PayPeriod pay = Session[];
      /*      DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("Date", typeof(string)));
            dt.Columns.Add(new DataColumn("Hours", typeof(Int32)));

            DataRow dr = dt.NewRow();
            dr[0] = "12-09-2009";

            //foreach(PayPeriod in pay)
            //{
            //}

            dr[1] = 8;

            dt.Rows.Add(dr);

            GridView1.DataSource = dt;
            GridView1.DataBind();*/
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
